Skip to content

OME-TIFF: remove extra Channels all at once - #4489

Merged
sbesson merged 2 commits into
ome:developfrom
melissalinkert:ome-tiff-memory-usage-develop
Oct 22, 2026
Merged

sbesson merged 2 commits into
ome:developfrom
melissalinkert:ome-tiff-memory-usage-develop

Conversation

@melissalinkert

Copy link
Copy Markdown
Member

This means the MetadataStore root only needs to be reset once, which for OMEPyramidStore (with resolution annotations present) means the memory usage is substantially reduced.

The issue can be demonstrated by converting test&plateRows=16&plateCols=24&fields=6&sizeX=512&sizeY=512&sizeC=3.fake to OME-TIFF through bioformats2raw/raw2ometiff and then running showinf -nopix -omexml on the OME-TIFF. An OutOfMemoryError should occur with default memory settings for showinf, i.e. BF_MAX_MEM was unset.

With this change and the same OME-TIFF, showinf -nopix -omexml with default memory completes and prints OME-XML without error. Setting BF_MAX_MEM as low as 230m (less than half of the default) should also work.

No impact on existing tests is expected.

This means the MetadataStore root only needs to be reset once,
which for OMEPyramidStore (with resolution annotations present)
means the memory usage is substantially reduced.
@melissalinkert melissalinkert added this to the 9.0.0 milestone Oct 15, 2026

@sbesson sbesson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After generating a plate OME-TIFF as described in the PR, I confirm that without this PR, the reader initialization using showinf -ome-xml without additional configuration runs out of heap space. Setting BF_MAX_MEM=2g is sufficient to initialize the file fully.

With this PR included, the reader initializes using the default memory settings and the OME-XML metadata is identical to the one generated without this PR.

For additional profiling, I used the JDK Flight Recorder and generated recording files that can be inspected using JDK Misson Control without this PR

Image

and with this PR

Image

These confirm the memory footprint is significantly reduced by removing the channels of all images in the plate in a single operation.

@sbesson
sbesson merged commit d54bf46 into ome:develop Oct 22, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants